class Animal {
        public Animal() {
            System.out.println("Animal构造方法");
        }
    static {
        System.out.println("Animal静态代码块");
    }
    {
        System.out.println("Animal实例代码块");
    }
}
class Dog extends Animal {
    public Dog() {
        System.out.println("Dog构造方法");
    }
    static {
        System.out.println("Dog静态代码块");
    }
    {
        System.out.println("Dog实例代码块");
    }
}
class Cat extends Animal {
    public Cat() {
        System.out.println("Cat构造方法");
    }
    static {
        System.out.println("Cat静态代码块");
    }
    {
        System.out.println("Cat实例代码块");
    }
}
public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog();
        System.out.println("-------------");
        Dog dog1 = new Dog();
        Cat cat = new Cat();
    }
}
